import axios from '@/utils/request'

export function baseURL() {
  return process.env.NODE_ENV == 'production'
    ? 'https://dist.ssw-htzn.com'
    : ' http://124.223.154.154:8888'
}

/**
 * @description: 获取微信商户列表
 * @return {*}
 */
export function getWxmchList() {
  return axios.get('/admin_api/common/wx_mch_list/')
}

export function getCourse(params) {
  return axios.get('/admin_api/v1/course/product', { params })
}

export function uploadImg(data) {
  return axios.post('/admin_api/v1/common/image/upload/', data, {
    headers: { 'Content-Type': 'multipart/form-data' }
  })
}

/**
 * @description: 获取城市列表
 */
export function getCityList(data) {
  return axios.get('/api/v1/common/province_city_list/', data)
}

/**
 * @description:权限列表
 */
export function getPermissionsList(params) {
  return axios.get(`/admin_api/account/permissions/`, {
    params
  })
}

export const uploadApi = `/admin_api/v1/common/image/upload/`

/**
 * @description: 获取临时签名
 * @param {*} data
 * @return {*}
 */
export function cosSign(data) {
  return axios.post('/admin_api/common/cos_sign/', data)
}
/**
 * @description: 订单统计数据
 */
export function getOrderStats(params) {
  return axios.get(`/admin_api/stats/order_stats/`, {
    params
  })
}
/**
 * @description: 景点统计数据
 */
export function getAttractionStats(params) {
  return axios.get(`/admin_api/stats/order_attraction_stats/`, {
    params
  })
}
